import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2023-11-22
 * Time: 17:31
 */
public class main8 {
    public static void main1(String[] args) {
        int[] arr = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        int a = arr.length;
        System.out.println(a);
        int left = 0;
        int right = a - 1;
        System.out.println(Arrays.toString(arr));
        while (left < right) {
            while (arr[left] % 2 != 0 && left < right) {
                left++;
            }
            while (arr[right] % 2 == 0 && left < right) {
                right--;
            }
            int tmp = arr[left];
            arr[left] = arr[right];
            arr[right] = tmp;
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main2(String[] args) {
        int[] arr = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        int a = arr.length;
        int left = 0;
        int right = a - 1;
        System.out.println(Arrays.toString(arr));
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int mid = 0;
        while (left < right) {
            mid = (left + right) / 2;
            if (n == arr[mid]) {
                System.out.println("找到了是" + mid);
                break;
            } else if (arr[mid] < n) {
                left = mid + 1;
            } else if (arr[mid] > n) {
                right = mid - 1;
            }
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main3(String[] args) {
        int[] arr = new int[]{1, 5, 6, 78, 9, 52, 55, 14, 53, 45};
        int a = arr.length;
        System.out.println(Arrays.toString(arr));
        for (int n = 0; n < a - 1; n++) {
            for (int j = 0; j < a - 1 - n; j++) {
                if (arr[j] > arr[j + 1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }

    public static void main4(String[] args) {
        int[] arr = new int[]{8, 9, 4, 5};
        int len = arr.length;
        Scanner in = new Scanner(System.in);
        int tmp = in.nextInt();
        for (int head = 0; head < len - 1; head++) {
            for (int tail = head + 1; tail < len; tail++) {
                if (arr[head] + arr[tail] == tmp) {
                    System.out.println(arr[head] + "+" + arr[tail] + "=" + tmp);
                    break;
                }
            }
        }
    }

    public static void main5(String[] args) {
        int[] arr = new int[]{4, 2, 2, 5, 6, 3, 6, 5, 4, 5, 4, 5, 9, 9};
        int[] array = new int[100];
        for (int i = 0; i < arr.length; i++) {
            array[arr[i]]++;
        }
        for (int i = 0; i < arr.length; i++) {
            if (array[i] == 1) {
                System.out.println(i + "只出现一次");
            }
        }
    }

    public static void main6(String[] args) {
        int[] arr = new int[]{2, 2, 1, 1, 2, 2};
        int a = arr.length;
        System.out.println(Arrays.toString(arr));
        for (int n = 0; n < a - 1; n++) {
            for (int j = 0; j < a - 1 - n; j++) {
                if (arr[j] > arr[j + 1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                }
            }
        }
        System.out.println(arr[a/2]);
    }
    //1,2,34,3,4,5,7,23,12
    public static void main(String[] args) {
        int[] arr=new int[]{1,2,34,3,4,5,23,7,12};
        int count=0;
        for (int i=0;i< arr.length;i++){
            if (arr[i]%2==0){
                count=0;
            }else {
                count++;
            }
            if (count==3){
                System.out.println("有三个奇数相连");
                break;
            }
        }
        if (count!=3){
            System.out.println("没有三个奇数相连");
        }
    }
}